<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="/styles/general.css" rel="stylesheet" type="text/css" />
<link href="/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/styles/validator.css" rel="stylesheet" type="text/css" />
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/js/formValidator.js" type="text/javascript"></script>
<script src="/js/formValidatorRegex.js" type="text/javascript"></script>
<script type="text/javaScript">
function getchild(parentid)
{
	$.ajax({
	  url: '/menu/saveajax/type/getchild/parentid/'+parentid+'/',
	  cache: false,
	  success: function(html)
	  {
		  parentid == 0 ?  $('#parent').html(html) : $('#parent').append(html); 
	  }
	});
}
</script>
</head>
<body>

<h1>
<span class="action-span"><a href="/menu/index/">管理菜单</a></span>
<span class="action-span1"><a href="/index/main/">管理中心</a> </span><span id="search_id" class="action-span1"> - 添加菜单 </span>
<div style="clear:both"></div>
</h1>
<div class="main-div">
  <form action="/menu/add/" method="post" name="myform" id="myform" enctype="multipart/form-data">
  <table width="100%" id="general-table">
    <caption><strong>添加菜单</strong></caption>
      <tr>
        <td class="label">上级菜单:</td>
        <td>
          <input name="info[parentid]" id="parentid" type="hidden" value="$parentid"><span id="parentname" style="color:red"><!--{if (''==$parentname)}-->无<!--{else}-->$parentname<!--{/if}--></span><span id="parent"></span> <a href="###" onclick="javascript:getchild(0);$('#parentname').hide();">重选</a>
        </td>
      </tr>
      <tr>
        <td class="label">菜单名称:</td>
        <td>
          <!--{form text $form_name}--> <font color="red">*</font> <div id="info_nameTip" style="width:250px"></div>
        </td>
      </tr>
      <tr>
        <td class="label">链接地址:</td>
        <td>
          <!--{form text $form_url}-->
        </td>
      </tr>
      <tr>
        <td class="label">打开窗口:</td>
        <td>
          <!--{form select $form_target}-->
        </td>
      </tr>

      <!--<tr>
        <td class="label">CSS样式:</td>
        <td>
          {form text $form_style}
        </td>
      </tr>-->
      <!--<tr>
        <td class="label">JS事件代码:</td>
        <td>
          {form text $form_js}
        </td>
      </tr>-->
      <!--<tr>
        <td class="label">管理员浏览权限:<br /> <CITE>如果都不选，则表示不限制</CITE></td>
        <td>
          {form checkbox $form_roleids}
        </td>
      </tr>
      <tr>
        <td class="label">对应资源:</td>
        <td>
          {form select $form_resource}
        </td>
      </tr>-->
      </table>
      <div class="button-div">
        <input type="submit" name="dosubmit" id="dosubmit" value=" 确定 "> 
        &nbsp; <input type="reset" name="reset" value=" 清除 ">
      </div>
    <input type="hidden" name="forward" value="$forward"> 
  </form>
</div>
{template 'footer.html'}
</body>
</html>
<script language="javascript" type="text/javascript">
$().ready(function() {
    $.formValidator.initConfig({formid:"myform",onerror:function(msg){alert(msg)}});
    $("#info_name").formValidator({onshow:"请输入菜单名称",onfocus:"请至少要输入2个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:2,onerror:"你输入的菜单名称长度不正确,请确认"});
});
</script>